/** * 2007-2023 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@buy-addons.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author Buy-addons * @copyright 2007-2023 Buy-addons * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ function isValidEmailTest(emailTest) { var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); return pattern.test(emailTest); }; function showpro_quote(jsonData){ var html = ''; for(i=0;i'; html+= ''; html+= ''; html+= ''+jsonData[i].name+''; html+= ''; html+= ''; html+= ''; html+= ''; html+= '

'+jsonData[i].name+'

'; html+= '
'; if(jsonData[i].attribute_dbboo == '' || jsonData[i].attribute_dbboo == undefined){ }else{ html+= ''+jsonData[i].attribute_dbboo+'
'; } if(jsonData[i].reference == ''){ }else{ html+= ''+table_header_sku + ' ' +jsonData[i].reference+'
'; } html+= ''; if (jsonData.check_opt_price == 1) { html+= ''; html+= jsonData[i].price_tax_formatted; html+= ''; } else { html+= ''; html+= jsonData[i].price_tax_formatted; html+= ''; } html+= ''; html+= '
'; html+= '
'; html+= ''; html+= '
'; html+= '
'; html+= '
'; html+= ''; html+= '
' html+= ''; html+= '
'; html+= '
'; html+= '
'; html+= ''; var t = jsonData[i].total_price_tax_formatted; if (jsonData.check_opt_price == 1) { html+= ''; html+= ''+ t +' '; html+= ''; }else{ html+= ''; html+= ''+ t +' '; html+= ''; } html+= ''; html+= ''; html+= ''; html+= ''; }; if(jsonData.number == 0){ jQuery(".quotes_cart_block").css("display", "none"); var html_warning_quote = ''; html_warning_quote += '
'; html_warning_quote += '

' + no_product_in_quote + '

' html_warning_quote += '
'; jQuery(".quote_body_new_dbboo").html(html_warning_quote); }; if(jsonData.number > 0) { jQuery(".quotes_cart_block").removeAttr("style"); if (jsonData.check_opt_price == 1) { html+= ''; html+= '
'+cart_total_l+'
'; html+= ''; html+= '' + jsonData._total_price_formatted +''; html+= ''; html+= ''; html+= ''; }else { html+= ''; html+= '
'+cart_total_l+'
'; html+= ''; html+= '' + jsonData._total_price_formatted +''; html+= ''; html+= ''; html+= ''; } } jQuery(".table_body").html(html); var html1 = ''; var html_count = ''; html_count+= ''; html_count+= ''; html_count+= ''; if(jsonData.number > 0 && jsonData.number < 2){ html_count+= ''+jsonData.number+''; } else if (jsonData.number >= 2){ html_count+= ''+jsonData.number+''; } else{ html_count+= '0'; } for(i=0;i'; html1+= ''+jsonData[i].name+''; html1+= ''; html1+= '
'; html1+= '

'+jsonData[i].name+'

';; if(jsonData[i].attr_dbboo == undefined){ html1+= ' '; }else{ html1+= ''+jsonData[i].attr_dbboo+''; } html1+= '
'; if (jsonData.check_opt_price == 1) { html1+= ''+ jsonData[i].price_tax_formatted+'
'; } else { html1+= ''+ jsonData[i].price_tax_formatted +'
'; } html1+= '
x'+jsonData[i].so_sp+''; html1+= '
'; html1+= ''; html1+= '
' html1+= '
'; html1+= ''; } if (jsonData.check_opt_price == 1) { html1+= '
'; html1+= 'Total:'; html1+= ''; html1+= jsonData._total_price_formatted; html1+= ''; html1+= '
'; } else { html1+= ''; } jQuery(".quote_body").html(html1); jQuery(".quotes").html(html_count); }; function del_product(id_combi_del,id_product){ var session_id_doubleboo = ss_id; var baseurl = window.location.hostname; var dp_count_del = jQuery('.count_dbboo'+ id_combi_del +'_'+ id_product +'').val(); var price_del = jQuery('.price'+ id_combi_del +'_'+ id_product +'').attr('value'); var price_tt_del = price_del * dp_count_del; var total_pri = jQuery('.total').attr('value'); var _total_pri = parseFloat(total_pri) - price_tt_del; jQuery('.total').val(_total_pri); jQuery('.total').html('...'); jQuery.ajax({ type: 'POST',//phương thức gửi jscrossDomain: window.location.hostname, crossDomain: true, url: askquote_base_url + 'index.php?controller=viewlist&fc=module&module=askforaquotemodul', // lấy link của controller mới data:'total_pri_del=' + _total_pri + '&id_product='+id_product + '&session_id=' + session_id_doubleboo + '&id_combination=' +id_combi_del +'&name_btn=del' + '"e_token=' + token_askaquotemodule + '&ajax=1', // lấy dữ liệu từ id product ở trên định nghĩa dataType:"json", success: function(jsonData,textStatus,jqXHR) { showpro_quote(jsonData); jQuery('.total').val(jsonData._total_price); jQuery('.total').html(jsonData._total_price_formatted); } }); jQuery(this).closest('tr').remove(); }; jQuery(document).ready(function(){ if (window['email_dbboo'] == undefined) { email_dbboo = 0; } else{ if(email_dbboo == 1) { if (error_email == 1) { jQuery(".email_dbboo").css("border", "1px solid red"); jQuery(".show_warning_email").show(); } else { jQuery(".email_dbboo").css("border", "1px solid #d6d4d4"); jQuery(".show_warning_email").hide(); } } } if (window['file_invalid'] == undefined) { file_invalid = 0; } else{ if (file_invalid == 1) { jQuery(".show_warning_file_invalid").show(); } else { jQuery(".show_warning_file_invalid").hide(); } } if (window['error_type'] == undefined) { error_type = 0; } else{ if (error_type == 1) { jQuery(".show_warning_file_type").show(); } else { jQuery(".show_warning_file_type").hide(); } } if (window['error_size'] == undefined) { error_size = 0; } else{ if (error_size == 1) { jQuery(".show_warning_file_size").show(); } else { jQuery(".show_warning_file_size").hide(); } } if (window['error_captcha'] == undefined) { error_captcha = 0; } else{ if (error_captcha == 1) { jQuery(".text_captcha").css("border", "1px solid red"); jQuery(".show_warning").show(); } else { jQuery(".text_captcha").css("border", "1px solid #d6d4d4"); jQuery(".show_warning").hide(); } } if (window['success_submit'] == undefined) { success_submit = 0; } else{ if (success_submit == 1) { jQuery(".show_success_quote").show(); } } });